<?php
if ($this->entity->diktmin AND $this->entity->diktmax) {
    
	print "<div class=\"dlinks\">";
	
	$this->app->getDocument()->head->script->add('/entities/31/ent_31.js');

	$coll = new Led_Entity_Collection(0, 18, 0, 2, 0, 60);
    $coll->setMinOrder($this->entity->diktmin);
    $coll->setMaxOrder($this->entity->diktmax);
    
	foreach($coll as $key => $value) {

		print "<div class=\"dlink_name\" onclick=\"openclose($value->id);\"><img id=\"dlink_image_$value->id\" alt=\"Arrow\" align=\"middle\" src=\"/entities/31/nuoli_alas.gif\" />" . $value->sname . "</div>";
		
		print "<div id=\"dlink_opener_$value->id\" class=\"dlink_opener\">";
		
		$dlinks = new Led_Entity_Collection(0, 30, null, 2, $value->id, 61);
				
		if (!$dlinks->count()) {
			print "Nada.";
		} else {
			foreach ($dlinks as $key2 => $value2) {
				print "<a target=\"_blank\" href=\"" . $value2->linkurl . "\">\n";
				print $value2->linktext;
				print "</a>\n";
				print"<br />";
			}
		
		}
		print "</div>\n";
	
	}
	print "</div>\n";
}


